//
//  ActivitiesDetailView.m
//  UI_豆瓣
//
//  Created by dllo on 15/10/26.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "ActivitiesDetailView.h"

@interface ActivitiesDetailView ()

@property (nonatomic, retain)UILabel *typeLabel;
@property (nonatomic, retain) UILabel *content1;
@property (nonatomic, retain) UIImageView *t1;
@property (nonatomic, retain) UIImageView *t2;
@property (nonatomic, retain) UIImageView *t3;
@property (nonatomic, retain) UIImageView *t4;

@end



@implementation ActivitiesDetailView

- (void)dealloc
{
    [_backgroundImageView release];
    [_title release];
    [_owner release];
    [_category release];
    [_address release];
    [_timeLabel release];
    [_content1 release];
    [_content2 release];
    [_t1 release];
    [_t2 release];
    [_t3 release];
    [_t4 release];
    [_typeLabel release];
    [super dealloc];
}


-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView
{
   
    //背景
    self.backgroundImageView = [[UIImageView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
    self.backgroundImageView.image = [UIImage imageNamed:@"gun.png"];
    self.backgroundImageView.alpha = 0.3;
    [self addSubview:self.backgroundImageView];

    
    //标题
    self.title = [[UILabel alloc] initWithFrame:CGRectMake(10, 20, 350, 50)];
    [self addSubview:self.title];
//    self.title.backgroundColor = [UIColor cyanColor];
    self.title.textAlignment = NSTextAlignmentLeft;
    self.title.font = [UIFont boldSystemFontOfSize:20];
    self.title.numberOfLines = 0;
    
    //图片
    self.activitylcon = [[ UIImageView alloc] initWithFrame:CGRectMake(10, 80, 120, 180)];
    self.activitylcon.backgroundColor = [UIColor cyanColor];
    [self.activitylcon setImage:[UIImage imageNamed:@""]];
    [self addSubview:self.activitylcon];
    //裁掉view的边界
    self.activitylcon.layer.masksToBounds = YES;
    //设置半径
    self.activitylcon.layer.cornerRadius = 10;
    
    
    //时间图标
    self.t1 = [[UIImageView alloc] initWithFrame:CGRectMake(140, 85, 32, 32)];
    [self.t1 setImage:[UIImage imageNamed:@"icon_date_blue@2x.png"]];
    [self addSubview:self.t1];
    
 
    
    //时间显示
    self.timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(170, 85, 200, 30)];
    self.timeLabel.font = [UIFont boldSystemFontOfSize:15];
    [self addSubview:self.timeLabel];
    [_timeLabel release];
    
   
    
    
    //人物
    self.t2 = [[UIImageView alloc] initWithFrame:CGRectMake(140, 120, 32, 32)];
    [self.t2 setImage:[UIImage imageNamed:@"icon_sponsor_blue@2x.png"]];
    [self addSubview:self.t2];
    
    self.owner = [[UILabel alloc] initWithFrame:CGRectMake(170, 120, 100, 30)];
    [self addSubview:self.owner];
//    self.owner.backgroundColor = [UIColor cyanColor];
    self.owner.textAlignment = NSTextAlignmentLeft;
    self.owner.font = [UIFont systemFontOfSize:18];
    self.owner.numberOfLines = 0;
    
    
    
    //类型图标
    self.t3 = [[UIImageView alloc] initWithFrame:CGRectMake(140, 160, 32, 32)];
    [self.t3 setImage:[UIImage imageNamed:@"icon_catalog_blue@2x.png"]];
    [self addSubview:self.t3];
    
    //类型内容
    self.category = [[UILabel alloc] initWithFrame:CGRectMake(220, 160, 100, 30)];
    [self addSubview:self.category];
//    self.category.backgroundColor = [UIColor cyanColor];
    self.category.textAlignment = NSTextAlignmentLeft;
    self.category.font = [UIFont systemFontOfSize:18];
    
    //类型:
    self.typeLabel = [[UILabel alloc]initWithFrame:CGRectMake(170, 160, 50, 30)];
    self.typeLabel.text = @"类型:";
    self.typeLabel.font = [UIFont systemFontOfSize:18];
    [self addSubview:self.typeLabel];
    [_typeLabel release];

    
    
    //地点图标
    self.t4 = [[UIImageView alloc] initWithFrame:CGRectMake(140, 200, 32, 32)];
    [self.t4 setImage:[UIImage imageNamed:@"icon_spot_blue@2x.png"]];
    [self addSubview:self.t4];
    
    //地点内容
    self.address = [[UILabel alloc] initWithFrame:CGRectMake(170, 200, 200, 30)];
    [self addSubview:self.address];
//    self.address.backgroundColor = [UIColor cyanColor];
    self.address.textAlignment = NSTextAlignmentLeft;
    self.address.font = [UIFont systemFontOfSize:18];
    self.address.numberOfLines = 0;
    
    
    
    //活动介绍
    self.content1 = [[UILabel alloc] initWithFrame:CGRectMake(10, 280, 120, 30)];
    [self addSubview:self.content1];
    self.content1.text = @"活动介绍";
    self.content1.textAlignment = NSTextAlignmentLeft;
    self.content1.font = [UIFont boldSystemFontOfSize:20];
    self.content1.numberOfLines = 0;
    
    
    
    //活动详情
    self.content2 = [[UILabel alloc] initWithFrame:CGRectMake(10, 320, 355, 30)];
    [self addSubview:self.content2];
    self.content2.textAlignment = NSTextAlignmentLeft;
    self.content2.font = [UIFont systemFontOfSize:18];
    self.content2.numberOfLines = 0;
   

    
}


    
    






/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
